package com.guigu.eduservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 检测报告表（存储设备检测的结果及结论）
 * </p>
 *
 * @author Xiaosong
 * @since 2025-10-13
 */
@Data
@TableName("detection_report")
public class DetectionReport implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 报告唯一标识
     */
    @TableId(value = "report_id", type = IdType.AUTO)
    private Long reportId;

    /**
     * 关联设备表equipment_id（唯一，一个设备仅一份检测报告）
     */
    private Long equipmentId;

    /**
     * 关联业务员表businessman_id（执行检测的评估师）
     */
    private Long businessmanId;

    /**
     * 检测时间（评估师现场检测的时间）
     */
    private LocalDateTime detectionTime;

    /**
     * 外观检测结果（正常/异常，异常需说明，如"右侧履带磨损严重"）
     */
    private String appearanceDetection;

    /**
     * 部件功能检测结果（正常/异常，异常需说明，如"液压泵漏油"）
     */
    private String componentFunctionDetection;

    /**
     * 性能参数检测结果（正常/异常，异常需说明，如"最大起重量不达标"）
     */
    private String performanceParameterDetection;

    /**
     * 检测结论（综合判断设备是否符合交易标准，如"设备整体状况良好，可正常交易"）
     */
    private String detectionConclusion;

    /**
     * 报告审核状态（0-待审核，1-审核通过，2-审核不通过）
     */
    private Boolean auditStatus;

    /**
     * 审核时间（报告状态变更为1或2时记录）
     */
    private LocalDateTime auditTime;

    /**
     * 审核备注（审核不通过时填写原因，如"检测项缺失"）
     */
    private String auditRemark;

    /**
     * 记录创建时间
     */
    private LocalDateTime createTime;

    /**
     * 记录更新时间
     */
    private LocalDateTime updateTime;
    /**
     * 其他表中的一列，关联其他表
     * **/
    @TableField(exist = false)
    private String imageUrl;

    public Long getReportId() {
        return reportId;
    }

    public void setReportId(Long reportId) {
        this.reportId = reportId;
    }

    public Long getEquipmentId() {
        return equipmentId;
    }

    public void setEquipmentId(Long equipmentId) {
        this.equipmentId = equipmentId;
    }

    public Long getBusinessmanId() {
        return businessmanId;
    }

    public void setBusinessmanId(Long businessmanId) {
        this.businessmanId = businessmanId;
    }

    public LocalDateTime getDetectionTime() {
        return detectionTime;
    }

    public void setDetectionTime(LocalDateTime detectionTime) {
        this.detectionTime = detectionTime;
    }

    public String getAppearanceDetection() {
        return appearanceDetection;
    }

    public void setAppearanceDetection(String appearanceDetection) {
        this.appearanceDetection = appearanceDetection;
    }

    public String getComponentFunctionDetection() {
        return componentFunctionDetection;
    }

    public void setComponentFunctionDetection(String componentFunctionDetection) {
        this.componentFunctionDetection = componentFunctionDetection;
    }

    public String getPerformanceParameterDetection() {
        return performanceParameterDetection;
    }

    public void setPerformanceParameterDetection(String performanceParameterDetection) {
        this.performanceParameterDetection = performanceParameterDetection;
    }

    public String getDetectionConclusion() {
        return detectionConclusion;
    }

    public void setDetectionConclusion(String detectionConclusion) {
        this.detectionConclusion = detectionConclusion;
    }

    public Boolean getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(Boolean auditStatus) {
        this.auditStatus = auditStatus;
    }

    public LocalDateTime getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(LocalDateTime auditTime) {
        this.auditTime = auditTime;
    }

    public String getAuditRemark() {
        return auditRemark;
    }

    public void setAuditRemark(String auditRemark) {
        this.auditRemark = auditRemark;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "DetectionReport{" +
            "reportId = " + reportId +
            ", equipmentId = " + equipmentId +
            ", businessmanId = " + businessmanId +
            ", detectionTime = " + detectionTime +
            ", appearanceDetection = " + appearanceDetection +
            ", componentFunctionDetection = " + componentFunctionDetection +
            ", performanceParameterDetection = " + performanceParameterDetection +
            ", detectionConclusion = " + detectionConclusion +
            ", auditStatus = " + auditStatus +
            ", auditTime = " + auditTime +
            ", auditRemark = " + auditRemark +
            ", createTime = " + createTime +
            ", updateTime = " + updateTime +
        "}";
    }
}
